Skip to content

Add 'The Python 2.3 Method Resolution Order'#116435

Merged
hugovk merged 7 commits into
python:mainfrom
hugovk:docs-add-mro
Apr 15, 2024
Merged

Add 'The Python 2.3 Method Resolution Order'#116435
hugovk merged 7 commits into
python:mainfrom
hugovk:docs-add-mro

Conversation

@hugovk

@hugovk hugovk commented Mar 6, 2024

Copy link
Copy Markdown
Member

Follow on from python/pythondotorg#2392.

Add "The Python 2.3 Method Resolution Order" document from https://www.python.org/download/releases/2.3/mro/ to the docs as an explanation.

Source reST taken from https://github.com/mdipierro/demo.python.org/blob/master/private/data/127.0.0.1/en/2.3/mro/mro.txt with minor formatting and link updates.


📚 Documentation preview 📚: https://cpython-previews--116435.org.readthedocs.build/

Comment thread Doc/howto/mro.rst
@hugovk

hugovk commented Mar 7, 2024

Copy link
Copy Markdown
Member Author

Doctest is failing for this file, but we don't want to run it all here.

Rather than adding # doctest: +SKIP to each block, can we skip the whole file?

@encukou

encukou commented Mar 11, 2024

Copy link
Copy Markdown
Member

3 failing doctests are for the old behaviour (Python 2.2/old-style classes), SKIP would make sense to me there.
For the A.mro() one, IMO it would make sense to remove __main__. from the expected output (and add # doctest: +NORMALIZE_WHITESPACE).

I'm not sure we can use Joan G. Stark's ASCII art snakes, unfortunately. It seems the terms of use are here: https://web.archive.org/web/20091028023223/http://www.geocities.com/SoHo/7373/please.htm
I guess they're fine on python.org directly, but for the docs we do allow redistribution for commercial/non-personal use.

@hugovk

hugovk commented Mar 11, 2024

Copy link
Copy Markdown
Member Author

3 failing doctests are for the old behaviour (Python 2.2/old-style classes), SKIP would make sense to me there. For the A.mro() one, IMO it would make sense to remove __main__. from the expected output (and add # doctest: +NORMALIZE_WHITESPACE).

Updated!

I'm not sure we can use Joan G. Stark's ASCII art snakes, unfortunately. It seems the terms of use are here: web.archive.org/web/20091028023223/http://www.geocities.com/SoHo/7373/please.htm I guess they're fine on python.org directly, but for the docs we do allow redistribution for commercial/non-personal use.

That's too bad, but thanks for checking. Removed!

@hugovk hugovk removed the needs backport to 3.11 only security fixes label Apr 2, 2024
@hugovk

hugovk commented Apr 14, 2024

Copy link
Copy Markdown
Member Author

@encukou Okay to merge now?

@encukou encukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, looks good. Thank you!

@hugovk hugovk merged commit 7d0be7a into python:main Apr 15, 2024
@hugovk hugovk deleted the docs-add-mro branch April 15, 2024 10:01
@miss-islington-app

Copy link
Copy Markdown

Thanks @hugovk for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @hugovk, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 7d0be7aea569b3bc9a3936501d7d32af87c70e73 3.12

@bedevere-app

bedevere-app Bot commented Apr 15, 2024

Copy link
Copy Markdown

GH-117885 is a backport of this pull request to the 3.12 branch.

hugovk added a commit to hugovk/cpython that referenced this pull request Apr 15, 2024
(cherry picked from commit 7d0be7a)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Apr 15, 2024
hugovk added a commit that referenced this pull request Apr 15, 2024
)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants